<template>
  <div>
    <div class="search">
      <div class="time"><p class="hinttime">申请日期</p> 
       <el-date-picker
      v-model="value1"
      type="daterange"
      range-separator="至"
      start-placeholder="开始日期"
      end-placeholder="结束日期">
    </el-date-picker></div>
      <div class="time"><p class="hinttime">申请状态

</p>  <el-radio-group v-model="radio">
    <el-radio :label="3">未批复
</el-radio>
    <el-radio :label="6">未批复</el-radio>
  </el-radio-group></div>
      <div class="time" ><p class="hinttime">消息类型</p>
      <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
  <div style="margin: 15px 0; margin-right:15px"></div>
  <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
    <el-checkbox v-for="city in cities" :label="city" :key="city">{{city}}</el-checkbox>
  </el-checkbox-group>
      </div>
      <div class="time" >
        <p class="hinttime" style="margin-left:15px"></p><el-button type="primary" icon="el-icon-search">搜索</el-button>
      </div>
    </div>
    <div class="contentlist">
       <el-table
       @cell-click="click"
      :cell-style="cellstyle"
        :header-cell-style="$headerstyle"
    :data="tableData3"
    border
    style="width: 100%">
    <el-table-column
      prop="date"
      label="申请类型"
      width="100">
    </el-table-column>
       <el-table-column
      prop="address"
      label="主题"
      class-name="nameclass"
      width="449">
    </el-table-column>
     <el-table-column
      prop="date"
      label="发起时间"
      width="150">
    </el-table-column>
 
   
    <el-table-column
      prop="name"
      label="待审批人"
      width="100">
    </el-table-column>
    <el-table-column
      prop="ed"
      width="100"
      
      label="编辑">
    </el-table-column>
    <el-table-column
      prop="status"
      width="100"
      
      label="查看审批路径">
    </el-table-column>
  </el-table>
  <div class="page">
<el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage3"
      :page-size="100"
      layout="prev, pager, next, jumper"
      :total="tableData3.length">
    </el-pagination>
  </div>
   
    </div>
  </div>
</template>
<script>
 const cityOptions = ['合同', '排期', '定制服务', '报备','产品策划','锁资源','媒体资源','补播','回款'];
export default {
  name:'mineapply',
  data() {
    return {
      checkAll: false,
        checkedCities: ['上海', '北京'],
        cities: cityOptions,
        isIndeterminate: true,
      currentPage3:1,
      value1:'',
      radio:'1',
         tableData3: [{
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }, {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }, {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }, {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }, {
          date: '2016-05-08',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }, {
          date: '2016-05-06',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }, {
          date: '2016-05-07',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄',
          status:'查看',
          ed:'编辑'
        }]
    }
  },
  methods: {
     handleCheckAllChange(val) {
        this.checkedCities = val ? cityOptions : [];
        this.isIndeterminate = false;
      },
      handleCheckedCitiesChange(value) {
        let checkedCount = value.length;
        this.checkAll = checkedCount === this.cities.length;
        this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
      },
    click(row,column,cell,event){
console.log(column)
this.open()
    },
       open() {
          this.$alert('<p>第一审批人：张三（未审批）</p>    <p>第一审批人：张三（未审批）</p>', '审批路径', {
          dangerouslyUseHTMLString: true,
          center:true
        });
      },
       handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
      },
     cellstyle({ row, column, rowIndex, columnIndex }){
 if (columnIndex === 4) {
        // 指定列号
        return 'color:#0000FF;text-decoration: underline;'
      } 
      if (columnIndex === 1) {
        // 指定列号
        return 'color:#0000FF;text-decoration: underline;'
      } 
      if (columnIndex === 5) {
        // 指定列号
        return 'color:#0000FF;text-decoration: underline;'
      } 
    },
  },
}
</script>
<style lang="scss">
.time{
  display: flex;
  align-items: center;
}
.hinttime{
  margin-right: 20px;
  margin-left: 30px;
  font-weight: 500;
}
.contentlist{
  width: 1000px;
  margin: 0 auto;
  margin-top: 50px;
  margin-bottom: 100px;
}
.page{
  width: 100%;
  display: flex;
  flex-direction: row-reverse;
  margin-top: 10px;
}
</style>